Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Injection plugins #2241

Closed
wants to merge 5 commits into from
Closed

Injection plugins #2241

wants to merge 5 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Sep 17, 2018

I want to propose a plugin which injects errors in configurations. This is my first idea and some sort of architecture document.

If it is accepted I will also add all information to Metadata.ini and error/specification (so many new metadatas are very timeconsuming).

Copy link
Contributor

@markus2330 markus2330 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, looks nice.

@@ -0,0 +1,325 @@
- infos = Information about the injection plugin is below
- infos/author = Markus Raab <elektra@libelektra.org>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong author.

- infos/recommends =
- infos/placements = presetstorage
- infos/status = maintained nodep
- infos/metadata = inject/randSeed inject/structure/sectionRemove inject/structure/sectionDuplicate inject/structure/sectionReallocate inject/semantic inject/resource inject/typo/transposition inject/typo/insertion inject/typo/caseToggle inject/typo/deletion inject/typo/changechar inject/typo/space inject/domain inject/limit/min inject/limit/max
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please avoid camel case, we always use / for separation. So it would be inject/rand/seed, ...

## Usage

There up to 6 error types currently with injection types for each.
1. Structural errors (e.g. missing sections, parameters in wrong sections, omission necessary parameters in section)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Afaik some markdown renderer need a newline in between so that this enumeration is recognized.

```

* Section Reallocator
* `inject/structure/sectionReallocate`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this the same as rename?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theoretically yes as you just "rename" the path. But behind the scenes it is actually really a key removal and adding on another place. As I could see it is not possible to change the name as elektra complains otherwise.

[logger]
inject/semantic/#0 = pyLog
inject/semantic/#1 = log4net
inject/semantic/#2 = Log4js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this a capitalization error?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the program expects a logging framework for the java domain but actually the user gives a loggingframework for python/.NET/JS as he might not know the correct one.

@ghost
Copy link
Author

ghost commented Sep 23, 2018

I changed everything. I also added another section concerning logging as I need to communicate which changes were done to lyrebird. Please take a short look over it if you also think this is a good idea.


## Logging of changes

To see which changes were applied to the whole KeySet, additional metadata will be written to the rootkey.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description is very short, it is not yet clear how this logging should work. In METADATA.ini logging is already proposed, maybe you can extend this work so that logging is not specific to the inject plugin?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In METADATA.ini logging is already proposed.

I do not see anything concerning logging in the metadata.ini

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe log is the wrong wording as I just want to backtrace injections which were done (i.e. typo error on setting xy, structure error on key zx, etc.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see anything concerning logging in the metadata.ini

Sorry, it was removed in 06e10ca and did not really contain useful information.

Maybe log is the wrong wording as I just want to backtrace injections which were done

Yes, better to change the wording then.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And why not add the changes directly to the keys where the changes occurred?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And why not add the changes directly to the keys where the changes occurred?

Because some injections simply remove a whole configuration/ section. It is also much simpler to use when all changes can be found on one key's metadata than searching for all keys if they have an injection on them imo

@ghost ghost added the ready to merge label Oct 13, 2018
@markus2330
Copy link
Contributor

Please only set "ready to merge" if the PR compiles.

@ghost
Copy link
Author

ghost commented Oct 15, 2018

This whole PR does only exist since you told me to do a PR for large README's so it is easier to comment on. You requested a change:

Yes, better to change the wording then.

which I did and as you again told me yourself I should mark the PR as "ready to merge" once you should look at it again. This PR wont get merged anyway so why do you require it to compile??

So what should I do now? Mark it/ write you an email/ label it with something otherwise/ just do an issue ...

@markus2330
Copy link
Contributor

You just replaced log -> change, what should I review here? Please request reviews more carefully.

The logging strategy should have already been a part of the architecture, so it is now quite complicated to give input about the big picture.

@mpranj suggested that we should have information that is passed from plugins to plugins in a separate keyset, similar to the plugin handle and plugin config. Your "logs/changes" would be much better placed there.

@ghost
Copy link
Author

ghost commented Oct 15, 2018

You just replaced log -> change, what should I review here? Please request reviews more carefully.

The only "task" you explicitly gave me is to change the wording. I did that and now want to see if the whole concept is finished. How should I tell you to take a whole look on the concept other than labeling the PR?

@mpranj suggested that we should have information that is passed from plugins to plugins in a separate keyset, similar to the plugin handle and plugin config. Your "logs/changes" would be much better placed there.

Where did he suggest that?

@mpranj
Copy link
Member

mpranj commented Oct 15, 2018

@Piankero we discussed it in the meeting last week, but I have not written anything about it in doc/decisions yet.

I needed some means of communication between plugins. I proposed to use a KeySet for my scenario and @markus2330 suggested that it can be useful for other plugins too. Plugins would have a handle to a "global" KeySet with the sole purpose of communication between plugins.

@ghost ghost closed this Mar 30, 2019
@ghost ghost deleted the injection-plugins branch March 30, 2019 09:21
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants